Optimizing my Ford-Fulkerson implementation for sparse graphs.
[and.git] / 10918 - Tri Tiling / 10918.cpp
blob0cffdb64db333ec8ccc57390ab24b6d1d166b201
1 /*
2 Wrong Answer.
3 */
4 #include <iostream>
6 using namespace std;
9 unsigned long long x[31], y[31], z[31];
11 int main(){
12 x[0] = 1; y[0] = 0; z[0] = 2;
13 x[1] = 0; y[1] = 2; z[1] = 0;
14 for (int i=2; i<=30; ++i){
15 x[i] = x[i-2] + y[i-1];
16 y[i] = z[i-1];
17 z[i] = 2*x[i-1] + y[i-1];
19 int n;
20 while (cin >> n && n != -1){
21 cout << x[n] << endl;
23 return 0;